<template>
  <div class="layout-container">
    <!-- 左侧菜单 -->
    <div class="sidebar">
      <ul>
        <li>
          <routerLink to="/" class="menu-link">返回首页</routerLink>
        </li>
        <li>
          <routerLink to="/myOrder" class="menu-link">我的订单</routerLink>
        </li>
        <li>
          <routerLink to="/userDetail" class="menu-link">个人信息</routerLink>
        </li>
        <li>
          <routerLink to="/myComment" class="menu-link">我的评价</routerLink>
        </li>
        <li>
          <routerLink to="/messageList" class="menu-link">我的消息</routerLink>
        </li>
      </ul>
    </div>

    <!-- 右侧内容 -->
    <div class="content">
      <routerView />
    </div>
  </div>
</template>

<style scoped>
/* 最外层容器 */
.layout-container {
  display: flex;
  width: 90%;
  height: 750px;
  margin: 40px auto 20px; /* 上方留白 40px，下方 20px */
  min-height: 600px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* 左侧菜单 */
.sidebar {
  width: 200px;
  background: #f9f9f9;
  border-right: 1px solid #eee;
  padding: 20px 10px;
  box-sizing: border-box;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin-bottom: 12px;
}

.menu-link {
  display: block;
  padding: 10px 14px;
  border-radius: 6px;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
}

.menu-link:hover {
  background: #ecf5ff;
  color: #409eff;
}

/* 当前激活路由高亮 */
.router-link-active {
  background: #409eff;
  color: #fff !important;
}

/* 右侧内容 */
.content {
  flex: 1;
  padding: 24px;
  box-sizing: border-box;
  background: #fff;
}
</style>
